Scale: Explain how to round value when !draw-value
authorDaniel Boles <dboles@src.gnome.org>
Tue, 2 May 2017 11:18:26 +0000 (12:18 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Tue, 2 May 2017 11:39:04 +0000 (12:39 +0100)
Scale:digits is (now, again) ineffective if Scale:draw-value is FALSE.
To get rounding in that case, the base Range:round-digits must be used.

gtk/gtkscale.c

index 97acd22cd376d4d3ce45f2680fa8f06e3c3c875a..b35dd5ec805ff7cc0c2fcbd78d6cdcb5dcf8d1de 100644 (file)
@@ -1084,9 +1084,10 @@ gtk_scale_new_with_range (GtkOrientation orientation,
  *     e.g. use 1 to display 1.0, 2 to display 1.00, etc
  *
  * Sets the number of decimal places that are displayed in the value. Also
- * causes the value of the adjustment to be rounded to this number of digits
- * whenever it is changed, so the retrieved value matches the displayed one, if
- * #GtkScale:draw-value is TRUE at the time of the change.
+ * causes the value of the adjustment to be rounded to this number of digits,
+ * so the retrieved value matches the displayed one, if #GtkScale:draw-value is
+ * %TRUE when the value changes. If you want to enforce rounding the value when
+ * #GtkScale:draw-value is %FALSE, you can set #GtkRange:round-digits instead.
  *
  * Note that rounding to a small number of digits can interfere with
  * the smooth autoscrolling that is built into #GtkScale. As an alternative,